<?php
/**
 * 信息成功
 * @param string $msg
 * @param string $url
 * @param int $code
 * @param string $data
 * @param int $wait
 * @return array
 */
function resData($msg = '', $url = '', $data = '', $code = 200, $wait = 3)
{
    return [
        'code' => $code,
        'data' => $data,
        'msg' => $msg,
        'url' => $url,
        'wait' => $wait,
    ];
}

/**
 * 信息错误
 * @param string $msg
 * @param int $code
 * @return array
 */
function resError($msg = '', $code = 403)
{
    return ['code' => $code, 'msg' => $msg];
}

function replace_img($img)
{
    return str_replace('\\', '/', $img);
}

function rep_split($img)
{
    $str = explode('.', $img);
    return $str[0] . '_thumb' . '.' . $str[1];
}